package net.hn.hnms.biz.safety.monitor.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import net.hn.hnms.biz.api.mine.model.GasIndicatorVo;
import net.hn.hnms.biz.api.safety.monitor.model.AirVolumeVo;
import net.hn.hnms.biz.api.safety.monitor.model.KeyAreasVo;
import net.hn.hnms.biz.api.safety.monitor.model.PointStatistics;
import net.hn.hnms.biz.api.safety.monitor.model.PointStatus;
import net.hn.hnms.biz.api.safety.water.model.SubsidenceAnalysisVo;
import net.hn.hnms.biz.safety.monitor.domain.vo.GasAnalysisVo;
import net.hn.hnms.biz.safety.monitor.service.SafetyMonitorService;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/7/28 14:59
 * 1.0 version
 */
@RestController
@RequestMapping("/riskWarning/gas")
@Api(value = "瓦斯预警控制器",tags = {"瓦斯预警"})
@RequiredArgsConstructor
public class RiskWarningGasController {
    private final SafetyMonitorService safetyMonitorService;

    @GetMapping("gasIndicator")
    @ApiOperation("重要指标")
    public R<GasIndicatorVo> gasIndicator() {
        //todo
        return R.ok(new GasIndicatorVo());
    }

    @GetMapping("sensor")
    @ApiOperation("工作面关联传感器")
    public R<List<KeyAreasVo>> sensorByFace(@ApiParam(value = "工作面id", required = true) String faceId) {
        //todo
        return R.ok(new ArrayList<>());
    }

    @GetMapping("gushTrend")
    @ApiOperation("瓦斯涌出量预测")
    public R<SubsidenceAnalysisVo> gushTrend() {
        return R.ok(safetyMonitorService.gushTrend());
    }

    @GetMapping("concentration")
    @ApiOperation("测点24小时趋势")
    @AutoSetMineCode
    public R<SubsidenceAnalysisVo> concentration(@ApiParam(value = "测点集合", required = true) String [] pointCodes,String mineCode) {
        return R.ok(safetyMonitorService.concentration(pointCodes,mineCode));
    }

    @GetMapping("pointStatistics")
    @ApiOperation("测点统计")
    public R<List<PointStatistics>> pointStatistics() {
        //todo
        return R.ok(new ArrayList<>());
    }

    @GetMapping("pointStatus")
    @ApiOperation("测点状态")
    @AutoSetMineCode
    public R<PointStatus> pointStatus(@ApiParam("工作面编码") String workFace, String mineCode) {

        return R.ok(safetyMonitorService.pointStatus(workFace,mineCode));
    }
    @GetMapping("airVolume")
    @ApiOperation("工作面风量")
    public R<AirVolumeVo> airVolume(@ApiParam(value = "工作面id", required = true) String faceId) {
        //todo
        return R.ok(new AirVolumeVo());
    }

    @ApiOperation("风排瓦斯涌出量变化趋势")
    @GetMapping("currentGasTrend")
    public R<GasAnalysisVo> currentGasTrend() {
        return R.ok(safetyMonitorService.getCurrentGasTrend());
    }


}
